home *** CD-ROM | disk | FTP | other *** search
/ CD School House 9 / CD School House 9.0 - Wayzata Technology (1994).iso / pc / dos / math / fsultra1 / demo.pas < prev    next >
Pascal/Delphi Source File  |  1992-06-18  |  3KB  |  113 lines

  1. FSU - ULTRA    The greatest random number generator that ever was
  2.         or ever will be.  Way beyond Super-Duper.
  3.         (Just kidding, but we think its a good one.)
  4.  
  5. Authors:    Arif Zaman (arif@stat.fsu.edu) and
  6.         George Marsaglia (geo@stat.fsu.edu).
  7.  
  8. Date:        27 May 1992
  9.  
  10. Version:    1.05
  11.  
  12. Copyright:    To obtain permission to incorporate this program into
  13.         any commercial product, please contact the authors at
  14.         the e-mail address given above or at
  15.  
  16.         Department of Statistics and
  17.         Supercomputer Computations Research Institute
  18.         Florida State University
  19.         Tallahassee, FL 32306.
  20.  
  21. See Also:    README        for a brief description
  22.         ULTRA.DOC    for a detailed description
  23.  
  24. -----------------------------------------------------------------------
  25. { This demo  calls the various ULTRA routines as a test }
  26.  
  27. {$X+}
  28. {$ifdef x}            uses ultrax;
  29. {$else}    {$ifdef f}        uses ultraf;
  30.     {$else}    {$ifdef fx}    uses ultrafx;
  31.         {$else}         uses ultra;
  32. {$endif}{$endif}{$endif}
  33.  
  34. var i:integer;
  35. begin
  36.   writeln;
  37.   writeln('A Sample Printout:');
  38.  
  39.   write('No rinit call: ');
  40.   for i:=1 to 10000 do
  41.   if (i<4) or (i=10000) then write(i32bit:16) else i32bit;
  42.   writeln;
  43.  
  44.   write('Signed 4 byte: ');
  45.   rinit(1234567,7654321);
  46.   for i:=1 to 10000 do
  47.   if (i<4) or (i=10000) then write(i32bit:16) else i32bit;
  48.   writeln;
  49.  
  50.   write('Uns. 4 byte:   ');
  51.   rinit(1234567,7654321);
  52.   for i:=1 to 10000 do
  53.   if (i<4) or (i=10000) then write(i31bit:16) else i31bit;
  54.   writeln;
  55.  
  56.   write('Signed 2 byte: ');
  57.   rinit(1234567,7654321);
  58.   for i:=1 to 10000 do
  59.   if (i<8) or (i=10000) then write(i16bit:8) else i16bit;
  60.   writeln;
  61.  
  62.   write('Uns. 2 byte:   ');
  63.   rinit(1234567,7654321);
  64.   for i:=1 to 10000 do
  65.   if (i<8) or (i=10000) then write(i15bit:8) else i15bit;
  66.   writeln;
  67.  
  68.   write('Signed byte:   ');
  69.   rinit(1234567,7654321);
  70.   for i:=1 to 10000 do
  71.   if (i<16) or (i=10000) then write(i8bit:4) else i8bit;
  72.   writeln;
  73.  
  74.   write('Uns. byte:     ');
  75.   rinit(1234567,7654321);
  76.   for i:=1 to 10000 do
  77.   if (i<16) or (i=10000) then write(i7bit:4) else i7bit;
  78.   writeln;
  79.  
  80.   write('Random bits:   ');
  81.   rinit(1234567,7654321);
  82.   for i:=1 to 10000 do
  83.   if (i<32) or (i=10000) then write(ord(i1bit):2) else i1bit;
  84.   writeln;
  85.  
  86.   write('Signed Single: ');
  87.   rinit(1234567,7654321);
  88.   for i:=1 to 10000 do
  89.   if (i<4) or (i=10000) then write(vni:16:7) else vni;
  90.   writeln;
  91.  
  92.   write('Uns. Single:   ');
  93.   rinit(1234567,7654321);
  94.   for i:=1 to 10000 do
  95.   if (i<4) or (i=10000) then write(uni:16:7) else uni;
  96.   writeln;
  97.  
  98.   write('Signed Double: ');
  99.   rinit(1234567,7654321);
  100.   for i:=1 to 10000 do
  101.   if (i<2) or (i=10000) then write(dvni:32:15) else dvni;
  102.   writeln;
  103.  
  104.   write('Unsigned Dble: ');
  105.   rinit(1234567,7654321);
  106.   for i:=1 to 10000 do
  107.   if (i<2) or (i=10000) then write(duni:32:15) else duni;
  108.   writeln;
  109.  
  110. end.
  111.